window.addEventListener('beforeunload', () => {
  // 清除一些缓存
})


function clearStore() { }



export function menuBarActive() {
  function hasMenuBarClass(target: HTMLElement) {
    if (!target) {
      return false
    }
    return target.className.includes('menu_bar')
  }
  window.addEventListener('touchstart', (e: TouchEvent) => {
    const target = e.target as HTMLElement

    if (hasMenuBarClass(target)) {
      target.classList.add('active')
    }

  })

  window.addEventListener('touchend', (e: TouchEvent) => {
    const target = e.target as HTMLElement

    if (hasMenuBarClass(target)) {
      target.classList.remove('active')
    }

  })
}

